package com.fs.sys.entityservice.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.fs.common.base.service.AbstractBaseEntityService;
import com.fs.sys.bean.dto.WorkbenchDTO;
import com.fs.sys.bean.query.WorkbenchQuery;
import com.fs.sys.domain.entity.WorkbenchEntity;
import com.fs.sys.domain.mapper.WorkbenchMapper;
import com.fs.sys.entityservice.WorkbenchEntityService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

/**
 * 工作台服务实现 
 * @author Coder Generator 2025-06-15 11:57:04 
 **/
@Service
public class WorkbenchEntityServiceImpl extends AbstractBaseEntityService<WorkbenchEntity, WorkbenchDTO, WorkbenchMapper, WorkbenchQuery> implements WorkbenchEntityService {
    @Override
    protected QueryWrapper<WorkbenchEntity> queryToWrapper(WorkbenchQuery query) {
        return this.createQueryWrapper()
                .eq(StringUtils.isNotBlank(query.getId()), "id", query.getId())
                .in(null != query.getIds(), "id", query.getIds())
                .eq(StringUtils.isNotBlank(query.getCreateUser()), "create_user", query.getCreateUser())
                .eq(null != query.getType(), "type", query.getType())
                .eq(null != query.getStatus(), "status", query.getStatus())
                .orderByDesc("create_time");
    }
}